<?php

namespace app\admin\validate;

use think\Validate;

class SupplierValidate extends Validate
{
    protected $rule = [
        'name' => 'require',
        'contact' => 'require',
        'discount' => 'require',
        'phone' => 'require|regex:/^[1][3,4,5,6,7,8,9][0-9]{9}$/',
        'tel' => 'require',
        'email' => 'email',
        'fax' => 'require',
        'website' => 'url',
        'region' => 'require',
        'address' => 'require',
        'bank' => 'require',
        'bank_account' => 'require'
    ];

    protected $msg = [
        'name.require' => '供应商名称不能为空',
        'contact.require' => '联系负责人不能为空',
        'discount.require' => '折扣不能为空',
        'phone.require' => '手机不能为空',
        'phone.regex' => '手机号格式错误',
        'tel.require' => '电话不能为空',
        'email' => '邮箱格式错误',
        'fax.require' => '传真不能为空',
        'website.require' => '网址不能为空',
        'region.require' => '地区不能为空',
        'address.require' => '详细地址不能为空',
        'bank.require' => '银行名称不能为空',
        'bank_account.require' => '银行卡号不能为空'
    ];
}
